<!--<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>-->

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <base href="<%=basePath%>">

    <title>发送短信</title>

    <meta name="pragma" content="no-cache">
    <meta name="cache-control" content="no-cache">
    <meta name="expires" content="0">
    <!--	<%@include file="../../script.html" %>-->
    <link th:insert="~{views/script :: tiancai}"/>

</head>
<body style="width:100%;max-width:500px;padding:30px 60px;">
<section class="info-section">
    <form id="form" method="post">
        <table>
            <tr>
                <td class="text-title">接收人姓名：</td>
                <td class="text-content">
                    <input type="text" name="sendtoname"
                           class="easyui-textbox theme-textbox-radius"
                           data-options="required:true,validType:'length[2,50]'">
                </td>
            </tr>
            <tr>
                <td class="text-title">接收人电话：</td>
                <td class="text-content">
                    <input type="text" name="phone" data-options="required:true"
                           class="easyui-textbox theme-textbox-radius">
                </td>
            </tr>
            <!--  <tr>
                <td class="text-title">信息正文：</td>
                <td class="text-content">
                    <textarea id="content" name="msgVO.content" rows="5"  cols="20"></textarea></td>
            </tr>
            -->
            <tr>
                <td colspan="2" style="text-align: center;margin-top: 10px;">
                    <a href="javascript:void(0);" id="sendBtn" class="easyui-linkbutton button-primary">发送</a>
                    <a href="javascript:void(0);" id="resetBtn" class="easyui-linkbutton button-danger">重置</a>
                </td>
            </tr>
        </table>
    </form>
</section>
<script type="text/javascript">

    //为发送按钮绑定单击事件
    $("#sendBtn").on("click", function () {

        //在提交之前调用编辑器的同步方法，这样才能获取到textarea中的内容
        //editor.sync();
        $("#form").form("submit", {
            url: "manage/marketing/MarketingAction_sendMsg.do",
            onSubmit: function () {
                return $("#form").form("validate");
            },

            success: function (data) {
                if (data) {
                    var json = eval("(" + data + ")");
                    if (json.success) {
                        $.messager.alert("提示", "信息发送成功");
                        return true;
                    }
                }
                $.messager.alert("警告", "信息发送失败");
            }

        });
    });

</script>
<script type="text/javascript">
    $(function () {
        //重置按钮
        $("#resetBtn").on("click", function (event) {
            $("#form").form("reset");
        });
    })
</script>
</body>
</html>